'use strict'

/**
 * @param {Egg.Application} app - egg application
 */
module.exports = (app) => {
	const { router, controller, jwt } = app

	// router.resources('users', '/users', controller.user)
	const { urlSysm } = app.config.baseUrl
	const subRouter = router.namespace(urlSysm + '/users')
	subRouter.post('/register', controller.user.register)
	subRouter.post('/login', controller.user.login)
	// subRouter.post('/add', jwt, controller.user.add)
	subRouter.post('/add', controller.user.add)
	subRouter.post('/del', controller.user.del)
	subRouter.post('/update', controller.user.update)
	subRouter.post('/updateList', controller.user.updateList)
	subRouter.post('/updatePwd', controller.user.updatePwd)
	subRouter.get('/list', controller.user.list)
	subRouter.get('/listAll', controller.user.listAll)
	subRouter.get('/findLike', controller.user.findLike)
	subRouter.get('/captche', controller.user.captche)
	subRouter.get('/getUserInfo', controller.user.getUserInfo)
	subRouter.get('/getRemarks', controller.user.getRemarks)
	subRouter.get('/getUserInfoById/:id', controller.user.getUserInfoById)
}
